package cn.tsmchina.one.util;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;

/**
 * 配置文件
 * @author  YUE
 * @date 2013-7-23 下午5:31:03
 */
public final class ConfigUtil
{
	private static final Map<String, Object> Data_Map = new HashMap<String, Object>();
	
	static
	{
		Properties properties = null;
		try
		{
			properties = new Properties();
			properties.load(ConfigUtil.class.getResourceAsStream("/config.properties"));
			for (Entry<Object, Object> en : properties.entrySet())
				Data_Map.put(String.valueOf(en.getKey()), en.getValue());
		} catch (Exception e)
		{
		}
		finally{
			if(null != properties)
			{
				properties.clear();
			}
		}
	}
	
	/**
	 * @author  YUE
	 * @date 2013-7-23 下午5:33:21
	 * @param key
	 * @return
	 */
	public static Object get(String key)
	{
		return Data_Map.get(key);
	}
}
